Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customizing the list of monitored network interfaces #18

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

daald
Copy link
Contributor

@daald daald commented Dec 13, 2023

This is a simple way to customize the selection of network interfaces. If INTERFACE_NAMES_OVERRIDE is set in muninlite.conf, that list is used instead of auto-detection. As muninlite.conf itself is also a script, it is even possible to write a custom command.

This feature is helpful in environments with virtual machines or containers, like docker or lxc where there are lots of br-*, veth*, lxcbr* etc interfaces where monitoring doesn't make much sense. I didn't find a way to reliably filter physical interfaces.

This is a simple way to customize the selection of network interfaces. If INTERFACE_NAMES_OVERRIDE is set in muninlite.conf, that list is used instead of auto-detection. As muninlite.conf
itself is also a script, it is even possible to write a custom command.
This feature is helpful in environments with virtual machines or containers, like docker or lxc where there are lots of br-*, veth*, lxcbr* etc interfaces where monitoring doesn't make much
sense. I didn't find a way to reliably filter physical interfaces.
./muninlite: 651: INTERFACE_NAMES_OVERRIDE: parameter not set
muninlite.conf Outdated Show resolved Hide resolved
Co-authored-by: Kenyon Ralph <[email protected]>
@steveschnepp
Copy link
Member

I'd like to avoid having the defaults in 2 different places. Specially since they are not exactly the same.

So, either have :

  1. a simple example in muninlite.conf and have the autodetection coded in muninlite.in
  2. the autodetection coded directly in muninlite.conf but no autodetection in muninlite.in

1 would be my preference as muninlite.conf is always executed regardless of the plugin called.

@daald
Copy link
Contributor Author

daald commented Dec 14, 2023

The location in muninlite.in is also always executed, except the PLUGINS list was reconfigured. but I can remove that commented line from the config if that's the matter.

Btw for my installation, I changed it even further, to only include active network interfaces:

INTERFACE_NAMES_OVERRIDE="$(sed 's/^ *//; s/:.*$//; / /d' /proc/net/dev | grep -P '^(eth|wlan|en)' | while read dev; do [ "$(cat "/sys/class/net/$dev/carrier" 2>/dev/null)" != 1 ] || echo "$dev"; done)"

I think it's worth keeping these expressions at least as a form of documentation.

@Neustradamus
Copy link

Dear @munin-monitoring, do you progress?

rany2 added a commit to rany2/openwrt_packages that referenced this pull request Jan 2, 2025
As muninlite doesn't appear to have had a release in a few years and activity
on the git repo appears to have stalled, we add some patches on our end for now.

Patches:

- 001->004 are upstream fixes from master.
- 100 is a submitted PR: munin-monitoring/muninlite#19
  to fix munin-monitoring/muninlite#14.
- 200->204 is a submitted PR to allow customizing the monitored network interfaces:
  munin-monitoring/muninlite#18. Despite the large
  number of patches it is actually a trivial change.

Signed-off-by: Rany Hany <[email protected]>
rany2 added a commit to rany2/openwrt_packages that referenced this pull request Jan 2, 2025
As muninlite doesn't appear to have had a release in a few years and activity
on the git repo appears to have stalled, we add some patches on our end for now.

Patches:

- 001->004 are upstream fixes from master.
- 100 is a submitted PR: munin-monitoring/muninlite#19
  to fix munin-monitoring/muninlite#14.
- 200->204 is a submitted PR to allow customizing the monitored network interfaces:
  munin-monitoring/muninlite#18. Despite the large
  number of patches it is actually a trivial change.

Signed-off-by: Rany Hany <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants